﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.FactoryManagement;

namespace Digitalmes.Model.FactoryManagement
{
    /// <summary>
    /// 编码方案
    /// </summary>
	[Table("EncodeScheme")]

    [Display(Name = "_Model.EncodeScheme")]
    public class EncodeScheme : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._EncodeScheme._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._EncodeScheme._Name")]
        [Comment("方案名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Name { get; set; }
        [Display(Name = "_Model._EncodeScheme._Code")]
        [Comment("方案代号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Code { get; set; }
        [Display(Name = "_Model._EncodeScheme._FormName")]
        [Comment("表单名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string FormName { get; set; }
        [Display(Name = "_Model._EncodeScheme._FormCode")]
        [Comment("表单代码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string FormCode { get; set; }
        [Display(Name = "_Model._EncodeScheme._SerialNumber")]
        [Comment("当前流水号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public long? SerialNumber { get; set; }
        [Display(Name = "_Model._EncodeScheme._Remark")]
        [Comment("备用")]
        public string Remark { get; set; }
        [Display(Name = "_Model._EncodeScheme._Active")]
        [Comment("激活")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? Active { get; set; }
        [Display(Name = "_Model._EncodeItem._Scheme")]
        [InverseProperty("Scheme")]
        public List<EncodeItem> EncodeItem_Scheme { get; set; }
        [Display(Name = "_Model._EncodeScheme._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
